<!--
  @author yangjiangming
  @date 2018/11/26 10:00
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head>
    <title>服务项-编辑</title>
    <th:block th:replace="common/common :: jscss"/>
</head>
<body>
<div class="layui-fluid order-modify-page">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="service-item-edit">
                <div class="layui-row layui-col-space30">
                    <div class="layui-col-xs6">
                        <div class="shuttle-box">
                            <div class="shuttle-row">项目类型</div>
                            <div class="shuttle-row group-wrapper">
                                <div class="layui-row layui-col-space5">
                                    <div class="layui-col-xs3 active">
                                        <button class="layui-btn layui-btn-primary layui-btn-fluid" >全部</button>
                                    </div>
                                    <div class="layui-col-xs3" th:each="group : ${serviceItemGroupDTOList}">
                                        <button class="layui-btn layui-btn-primary layui-btn-fluid"
                                                data-th-data-id="${group.servItemGroupId}"
                                                th:text="${group.servItemGroupName}">
                                        </button>
                                    </div>
                                </div>
                            </div>
                            <div class="shuttle-row">服务项目</div>
                            <div class="service-item-wrapper">
                                <table id="demo" lay-filter="serviceItem" lay-skin="nob">
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="shuttle-box">
                            <div class="shuttle-row">已选项目</div>
                            <div class="selected-item-wrapper">
                                <table id="demo1" lay-filter="selectedItem" lay-skin="nob">
                                </table>
                            </div>
                            <div class="shuttle-row" style="text-align:right; color: #ff7c25;">合计：<span id="total"></span></div>
                        </div>
                    </div>
                </div>
                <div class="btn-wrapper">
                    <form class="layui-form" action="/work/modify/save/serviceitem.action" >
                        <input type="hidden" name="workId" th:value="${selectedItem.workId}">
                        <input type="hidden" name="orderId" th:value="${selectedItem.orderId}">
                        <input type="hidden" name="proExtId" th:value="${selectedItem.proExtId}">
                        <input type="hidden" name="productName" th:value="${selectedItem.productName}">
                        <input type="hidden" name="productId" th:value="${selectedItem.productId}">
                        <input type="hidden" name="servItemType" th:value="${selectedItem.servItemType}">
                        <button class="layui-btn" id="btn-save" lay-submit lay-filter="service-item">保存</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/html" id="itemTpl">
    <p class="name">
        <span>{{d.servItemName}}</span>
        <span class="subtitle">{{d.servItemGroupName}}</span>
    </p>
</script>

<script type="text/html" id="addTpl">
    <button class="layui-btn layui-btn-xs round" lay-event="add">
        <i class="layui-icon layui-icon-add-1"></i>
    </button>
</script>

<script type="text/html" id="minusTpl">
    <button class="layui-btn layui-btn-primary layui-btn-xs round" lay-event="minus">
        <i class="layui-icon layui-icon-add-1"></i>
    </button>
</script>

<script type="text/html" id="editPrice">
    {{#  if(d.manualPrice === 2){ }}
    <button class="layui-btn layui-btn-primary layui-btn-md round btn-edit-price" lay-event="edit">
        <i class="layui-icon layui-icon-edit"></i>
    </button>
    {{#  } }}
</script>

<script type="text/html" id="editToolbar">
    {{#  if(d.manualPrice === 2){ }}
        <a class="layui-btn layui-btn-xs" lay-event="edit">改价</a>
    {{#  } }}
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">删除</a>
</script>

<script th:inline="javascript">
    var json = {
        groupList: [[${serviceItemGroupDTOList}]],
        selectedItem: [[${selectedItem}]]
    };

    layui.config({
        base: "/static/js/module/"
    }).extend({
        oms_work_modify_serviceitem_edit: "work/modify/zmn.oms.work.modify.serviceitem.edit"
    }).use(['index', 'oms_work_modify_serviceitem_edit']);
</script>

</body>
</html>